#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

int T[12], D[12], L[12];
bool us[12];
bool ans;
int n;
void dfs(int x, int time)
{
    if (ans == true)
    {
        return;
    }
    if (x == n)
    {
        ans = true;
        return;
    }
    for (int i = 1;i <= n;i++)
    {
        if (us[i] == false && time <= T[i] + D[i])
        {
            us[i] = true;
            dfs(x + 1, max(time, T[i] + D[i]));
            if (ans == true)
            {
                return;
            }
            us[i] = false;
        }
    }
}

void sl()
{
    cin >> n;
    ans = false;
    for (int i = 1;i <= n;i++)
    {
        cin >> T[i] >> D[i] >> L[i];
        us[i] = false;
    }
    dfs(0, 0);
    if (ans == true)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
}

int main()
{
    int N;
    cin >> N;
    for (int i = 1;i <= N;i++)
    {
        sl();
    }
    return 0;
}
